/**
 * 
 */
package com.fly.sms.adapter;

import java.util.List;
import java.util.Map;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.fly.sms.CommonActivity;
import com.fly.sms.R;

public class CustomerNumberPoolListAdapter extends IAdapter {
	private List<Map<String, Object>> list=null;

	public CustomerNumberPoolListAdapter(CommonActivity context,List<Map<String, Object>> list) {
		super(context);
		this.list=list;
	}

	public int getCount() {
		return  list.size();
	}

	public Object getItem(int position) {
		return position;
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView==null){
			convertView=context.getView(R.layout.customernumberpoolitem);
		}
		Map<String, Object> customerContent=list.get(position);
		TextView name=(TextView)convertView.findViewById(R.id.name);
		TextView count=(TextView)convertView.findViewById(R.id.count);
		name.setText(customerContent.get("Name").toString());
		count.setText(customerContent.get("count").toString());
		return convertView;
	}
}
